summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2024-02-22 18:30:26 +0100
committerGitHub <noreply@github.com>2024-02-22 18:30:26 +0100
commit4f95ee52097762fcd53c135fcf07511898c48194 (patch)
tree1773373bf6c4b9b2556e7352b5de469bd9859695
parentMerge pull request #13105 from t895/connection-fix (diff)
parentshader_recompiler: throw on missing geometry streams in geometry shaders (diff)
downloadyuzu-4f95ee52097762fcd53c135fcf07511898c48194.tar
yuzu-4f95ee52097762fcd53c135fcf07511898c48194.tar.gz
yuzu-4f95ee52097762fcd53c135fcf07511898c48194.tar.bz2
yuzu-4f95ee52097762fcd53c135fcf07511898c48194.tar.lz
yuzu-4f95ee52097762fcd53c135fcf07511898c48194.tar.xz
yuzu-4f95ee52097762fcd53c135fcf07511898c48194.tar.zst
yuzu-4f95ee52097762fcd53c135fcf07511898c48194.zip
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.cpp4
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_special.cpp8
-rw-r--r--src/shader_recompiler/profile.h1
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp1
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h5
5 files changed, 16 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
index 0031fa5fb..3f9698d6b 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
@@ -261,7 +261,9 @@ void DefineEntryPoint(const IR::Program& program, EmitContext& ctx, Id main) {
case Stage::Geometry:
execution_model = spv::ExecutionModel::Geometry;
ctx.AddCapability(spv::Capability::Geometry);
- ctx.AddCapability(spv::Capability::GeometryStreams);
+ if (ctx.profile.support_geometry_streams) {
+ ctx.AddCapability(spv::Capability::GeometryStreams);
+ }
switch (ctx.runtime_info.input_topology) {
case InputTopology::Points:
ctx.AddExecutionMode(main, spv::ExecutionMode::InputPoints);
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
index 9f7b6bb4b..f60da758e 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
@@ -129,7 +129,9 @@ void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) {
if (ctx.runtime_info.convert_depth_mode && !ctx.profile.support_native_ndc) {
ConvertDepthMode(ctx);
}
- if (stream.IsImmediate()) {
+ if (!ctx.profile.support_geometry_streams) {
+ throw NotImplementedException("Geometry streams");
+ } else if (stream.IsImmediate()) {
ctx.OpEmitStreamVertex(ctx.Def(stream));
} else {
LOG_WARNING(Shader_SPIRV, "Stream is not immediate");
@@ -140,7 +142,9 @@ void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) {
}
void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) {
- if (stream.IsImmediate()) {
+ if (!ctx.profile.support_geometry_streams) {
+ throw NotImplementedException("Geometry streams");
+ } else if (stream.IsImmediate()) {
ctx.OpEndStreamPrimitive(ctx.Def(stream));
} else {
LOG_WARNING(Shader_SPIRV, "Stream is not immediate");
diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h
index 7578d41cc..90e46bb1b 100644
--- a/src/shader_recompiler/profile.h
+++ b/src/shader_recompiler/profile.h
@@ -44,6 +44,7 @@ struct Profile {
bool support_gl_derivative_control{};
bool support_scaled_attributes{};
bool support_multi_viewport{};
+ bool support_geometry_streams{};
bool warp_size_potentially_larger_than_guest{};
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 20f7a9702..d34b585d6 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -352,6 +352,7 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
.support_native_ndc = device.IsExtDepthClipControlSupported(),
.support_scaled_attributes = !device.MustEmulateScaledFormats(),
.support_multi_viewport = device.SupportsMultiViewport(),
+ .support_geometry_streams = device.AreTransformFeedbackGeometryStreamsSupported(),
.warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyBiggerThanGuest(),
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index a2ec26697..e3abe8ddf 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -499,6 +499,11 @@ public:
return extensions.transform_feedback;
}
+ /// Returns true if the device supports VK_EXT_transform_feedback properly.
+ bool AreTransformFeedbackGeometryStreamsSupported() const {
+ return features.transform_feedback.geometryStreams;
+ }
+
/// Returns true if the device supports VK_EXT_custom_border_color.
bool IsExtCustomBorderColorSupported() const {
return extensions.custom_border_color;